import functionListAuthorizationRepository from '@/repositories/functionListAuthorization'

const getFunctionListAuth = async (functionListId) => {
  let result = await functionListAuthorizationRepository.getFunctionListAuth(functionListId)
  return result
}

const getFunctionListWithPageParams = async (pageParams) => {
  return await functionListAuthorizationRepository.getFunctionListWithPageParams(pageParams)
}

const addFunction = async (newFunction) => {
  return await functionListAuthorizationRepository.addFunction(newFunction)
}

const updateFunction = async (func) => {
  return await functionListAuthorizationRepository.updateFunction(func)
}

const deleteFunctionById = async (functionId) => {
  return await functionListAuthorizationRepository.deleteFunctionById(functionId)
}

const addFunctionAuth = async (newFunctionAuth) => {
  return await functionListAuthorizationRepository.addFunctionAuth(newFunctionAuth)
}

const deleteFunctionAuth = async (functionAuthId) => {
  return await functionListAuthorizationRepository.deleteFunctionAuth(functionAuthId)
}

export default {
  getFunctionListAuth: getFunctionListAuth,
  getFunctionListWithPageParams: getFunctionListWithPageParams,
  addFunction: addFunction,
  updateFunction: updateFunction,
  deleteFunctionById: deleteFunctionById,
  addFunctionAuth: addFunctionAuth,
  deleteFunctionAuth: deleteFunctionAuth
}
